import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/global.css'
import './assets/ali-icon/iconfont.css'
import axios from 'axios'

/* 导入富文本编辑器 */
import VueQuillEditor from 'vue-quill-editor'

/* 导入富文本编辑器对应的样式 */
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme



/* 设定默认的ajax拦截路径 */
axios.defaults.baseURL = 'http://localhost:8091/'
/* 定义默认的axios拦截器 默认添加请求头信息,添加token信息 */
axios.interceptors.request.use( config => {
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config;
})
/* 定义全局的axios变量 */
Vue.prototype.$http = axios
Vue.config.productionTip = false

/* 将富文本编辑器注册为全局可用的组件 */
Vue.use(VueQuillEditor)




/* 定义过滤器 */
Vue.filter("priceFormat",function(price){

    return (price / 100).toFixed(2)
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
